home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel,comp.std.c
- Subject: Re: Hungarian notation
- Followup-To: comp.std.c
- Date: 23 Jan 1996 08:02:21 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4e2ppd$lsu@solutions.solon.com>
- References: <30C40F77.53B5@swsbbs.com> <SPENCER.96Jan22113215@zorgon.ERA.COM> <4e1nd8$hv0@solutions.solon.com> <3104bfc8.132251392@nntp.ix.netcom.com>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <3104bfc8.132251392@nntp.ix.netcom.com>,
- Mike Rubenstein <miker3@ix.netcom.com> wrote:
- >seebs@solutions.solon.com (Peter Seebach) wrote:
- >> > char a;
- >> > int b;
-
- >> > int main()
- >> > {
- >> > b = -154267 ;
- >> > a = b ;
- >> > return 0 ;
- >> > }
-
- >> No warnings, perhaps, but undefined behavior unless CHAR_MIN is
- >> less than or equal to -154267.
-
- >That does not result in undefined behavior. From ISO 6.2.1.2:
-
- > When a value with integral type is demoted to a signed integer
- > with smaller size or an unsigned integer is converted to its
- > corresponding signed integer, if the value cannot be
- > represented the result is implementation defined.
-
- >An implementation must handle this and must document how it does so.
-
- Cool! A standard bug!
-
- Appendix G.2, 2/3rds of the way down the page
- -- An arithmetic conversion produces a result that cannot be
- represented in the space provided. (6.2.1)
-
- In reality, it's in 6.2.1.3 that the statement is made, and it only
- applies to floating->integer conversions.
-
- Oops! This is what I get for believing the standard's appendicies without
- confirmation.
-
- Newsgroups now include comp.std.c, and followups go there.
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
- C/Unix proto-wizard -- C/Unix questions? Send mail for help. No, really!
- Using trn? Weird new newsgroup problem? I know the fix! Email me!
- The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq - Not A Flying Toy
-